package com.bioroadlab.pojo;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@Table(name = "sample_info", catalog = "bioroadlab")
public class SampleInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private TestStatus testStatus;
	private Timestamp issueTime;
	private BigDecimal price;
	private Integer sourceOrder;
	private String code;
	private String id;
	private String clinicOrWard;
	private String bloodType;
	private String specialNote;
	private String sampleType;
	private String cash;
	private BigDecimal remittance;
	private Timestamp remitDate;
	private BigDecimal amount;
	private Timestamp paperReportDate;
	private Timestamp EReportDate;
	private String needInvoice;
	private Timestamp invoiceDate;
	private String needReport;
	private Timestamp reportSendDate;
	private Patient patient;
	private Integer client;
	private String personInCharge;
	private String editor;
	private String conclusion;
	private Integer parent;
	private Timestamp editTime;
	private String place;
	private Set<SampleTube> sampleTubes = new HashSet<SampleTube>(0);
	private Set<TestItem> testItems = new HashSet<TestItem>(0);

	@TableGenerator(table = "id_generator", name = "generator", pkColumnName = "name", pkColumnValue = "SampleInfo", valueColumnName = "id", initialValue = 1, allocationSize = 1)
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "patient", nullable = false)
	public Patient getPatient() {
		return this.patient;
	}

	public void setPatient(Patient patient) {
		this.patient = patient;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "test_status", nullable = false)
	public TestStatus getTestStatus() {
		return this.testStatus;
	}

	public void setTestStatus(TestStatus testStatus) {
		this.testStatus = testStatus;
	}

	@Column(name = "issue_time", length = 19)
	public Timestamp getIssueTime() {
		return this.issueTime;
	}

	public void setIssueTime(Timestamp issueTime) {
		this.issueTime = issueTime;
	}

	@Column(name = "price", precision = 12)
	public BigDecimal getPrice() {
		return this.price;
	}

	public void setPrice(BigDecimal price) {
		this.price = price;
	}

	@Column(name = "source_order")
	public Integer getSourceOrder() {
		return this.sourceOrder;
	}

	public void setSourceOrder(Integer sourceOrder) {
		this.sourceOrder = sourceOrder;
	}

	@Column(name = "code")
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "id")
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "clinic_or_ward", length = 2)
	public String getClinicOrWard() {
		return this.clinicOrWard;
	}

	public void setClinicOrWard(String clinicOrWard) {
		this.clinicOrWard = clinicOrWard;
	}

	@Column(name = "blood_type")
	public String getBloodType() {
		return this.bloodType;
	}

	public void setBloodType(String bloodType) {
		this.bloodType = bloodType;
	}

	@Column(name = "special_note")
	public String getSpecialNote() {
		return this.specialNote;
	}

	public void setSpecialNote(String specialNote) {
		this.specialNote = specialNote;
	}

	@Column(name = "sample_type")
	public String getSampleType() {
		return this.sampleType;
	}

	public void setSampleType(String sampleType) {
		this.sampleType = sampleType;
	}

	@Column(name = "cash", length = 2)
	public String getCash() {
		return this.cash;
	}

	public void setCash(String cash) {
		this.cash = cash;
	}

	@Column(name = "remittance", precision = 12)
	public BigDecimal getRemittance() {
		return this.remittance;
	}

	public void setRemittance(BigDecimal remittance) {
		this.remittance = remittance;
	}

	@Column(name = "remit_date", length = 19)
	public Timestamp getRemitDate() {
		return this.remitDate;
	}

	public void setRemitDate(Timestamp remitDate) {
		this.remitDate = remitDate;
	}

	@Column(name = "amount", precision = 12)
	public BigDecimal getAmount() {
		return this.amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	@Column(name = "paper_report_date", length = 19)
	public Timestamp getPaperReportDate() {
		return this.paperReportDate;
	}

	public void setPaperReportDate(Timestamp paperReportDate) {
		this.paperReportDate = paperReportDate;
	}

	@Column(name = "e_report_date", length = 19)
	public Timestamp getEReportDate() {
		return this.EReportDate;
	}

	public void setEReportDate(Timestamp EReportDate) {
		this.EReportDate = EReportDate;
	}

	@Column(name = "need_invoice", length = 2)
	public String getNeedInvoice() {
		return this.needInvoice;
	}

	public void setNeedInvoice(String needInvoice) {
		this.needInvoice = needInvoice;
	}

	@Column(name = "invoice_date", length = 19)
	public Timestamp getInvoiceDate() {
		return this.invoiceDate;
	}

	public void setInvoiceDate(Timestamp invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

	@Column(name = "need_report", length = 2)
	public String getNeedReport() {
		return this.needReport;
	}

	public void setNeedReport(String needReport) {
		this.needReport = needReport;
	}

	@Column(name = "report_send_date", length = 19)
	public Timestamp getReportSendDate() {
		return this.reportSendDate;
	}

	public void setReportSendDate(Timestamp reportSendDate) {
		this.reportSendDate = reportSendDate;
	}

	@Column(name = "client")
	public Integer getClient() {
		return this.client;
	}

	public void setClient(Integer client) {
		this.client = client;
	}

	@Column(name = "person_in_charge", length = 50)
	public String getPersonInCharge() {
		return this.personInCharge;
	}

	public void setPersonInCharge(String personInCharge) {
		this.personInCharge = personInCharge;
	}

	@Column(name = "editor", length = 50)
	public String getEditor() {
		return this.editor;
	}

	public void setEditor(String editor) {
		this.editor = editor;
	}

	@Column(name = "conclusion", length = 500)
	public String getConclusion() {
		return this.conclusion;
	}

	public void setConclusion(String conclusion) {
		this.conclusion = conclusion;
	}

	@Column(name = "parent")
	public Integer getParent() {
		return this.parent;
	}

	public void setParent(Integer parent) {
		this.parent = parent;
	}

	@Column(name = "edit_time", length = 19)
	public Timestamp getEditTime() {
		return this.editTime;
	}

	public void setEditTime(Timestamp editTime) {
		this.editTime = editTime;
	}

	@Column(name = "place", length = 45)
	public String getPlace() {
		return this.place;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "sampleInfo")
	public Set<SampleTube> getSampleTubes() {
		return this.sampleTubes;
	}

	public void setSampleTubes(Set<SampleTube> sampleTubes) {
		this.sampleTubes = sampleTubes;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "sampleInfos")
	public Set<TestItem> getTestItems() {
		return this.testItems;
	}

	public void setTestItems(Set<TestItem> testItems) {
		this.testItems = testItems;
	}

}